#!/bin/sh

. $SRC/lib/wait.sh
setup_wait

# dont OOM kill me
echo -1000 > /proc/$$/oom_score_adj

while :
do
	wait_timeout 11

	[ -f "$TMP/job-finished" ] && exit

	check_oom && break
done

touch $RESULT_ROOT/OOM
echo "Out of memory, stop tests programs"
kill_tests
